package edu.sfsu.powerrangers.jeopardy.gamestate;

import java.io.Serializable;
import java.util.Vector;

public class Category extends Vector<Clue> implements Cloneable, Serializable {
	private static final long serialVersionUID = 1L;
	
	private String categoryName;
	private boolean categoryRevealed;
	
	public Category(String categoryName) {
		this.categoryName = categoryName;
		this.categoryRevealed = false;
	}
	
	public Category clone() {
		Category cat = new Category(categoryName);
		for (Clue c : this) cat.add(c.clone());
		return cat;
	}
	
	public String getCategoryName() {
		return categoryName;
	}
	
	public boolean isCategoryRevealed() {
		return categoryRevealed;
	}
	
	public void revealCategory() {
		categoryRevealed = true;
	}
	
	public boolean allRespondedTo() {
		for (Clue c : this)
			if (!c.isRespondedTo())
				return false;
		return true;
	}
	
	public int getMaxValue() {
		int v = 0;
		for (Clue c : this)
			if (c.getValue() > v)
				v = c.getValue();
		return v;
	}
}
